/*
 * application.cpp
 *
 *  Created on: 05.10.2011
 *      Author: jolo
 */

#include "application.hpp"

#include <widgets/main_window.hpp>

#include "main_window.hpp"

namespace gui
{

    application::application(int argc, char** argv)
    : core::application(argc, argv),
    main_window_(0)
    {
        main_window_ = new main_window();
        connect(this, SIGNAL(aboutToQuit()), 
                this, SLOT(quit()));
        connect(this, SIGNAL(application_status_changed(const QString&)), main_window_, 
                SLOT(on_application_status_change(const QString&)));
        connect(this, SIGNAL(repository_opened(model::repository_ptr)), 
                main_window_, SLOT(on_repository_opened(model::repository_ptr)));
        connect(this, SIGNAL(repository_closed()), 
                main_window_, SLOT(on_repository_closed()));
    }

    application::~application()
    {
    }

    void application::init()
    {
        emit application_status_changed(tr("Intializing Application..."));
        emit application_status_changed(tr("Ready"));
    }

    void application::show_main_window()
    {
        main_window_->show();
    }
}
